package com.kfc.platform.coin.domain;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "kfc_coin")
@GenericGenerator(name = "coin", strategy = "native")
public class Coin {
	private int id;
	private String coinname;//虚拟币名称
	private BigDecimal price;//虚拟币现价
	private BigDecimal percent;//虚拟币24小时涨跌幅
	public String getCoinname() {
		return coinname;
	}
	@Id
	@GeneratedValue(generator="coin")
	public int getId() {
		return id;
	}
	@Column(nullable=false)
	@NotNull(message="虚拟币涨跌幅不能为空!")
	public BigDecimal getPercent() {
		return percent;
	}
	@Column(nullable=false)
	@NotNull(message="虚拟币价格不能为空!")
	public BigDecimal getPrice() {
		return price;
	}
	@Column(nullable=false)
	@NotNull(message="虚拟币名称不能为空!")
	public void setCoinname(String coinname) {
		this.coinname = coinname;
	}
	public void setId(int id) {
		this.id = id;
	}
	public void setPercent(BigDecimal percent) {
		this.percent = percent;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
}
